package cn.alm.serviceorder.feign.fallback;

import cn.alm.serviceorder.entity.Product;
import cn.alm.serviceorder.feign.ProductFeignClient;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;

@Component
public class ProductFeignClientFallback implements ProductFeignClient {

    @Override
    public Product getProductById(Long id) {
        System.out.println("调用商品服务失败，这是一个fallback");
        Product product = new Product();
        product.setId(id);
        product.setProductName("虚拟商品名称");
        product.setPrice(new BigDecimal(8888));
        product.setNum(1);
        System.out.println("返回虚拟商品信息");
        return product;
    }

}
